package net.zui.entity;

import net.zui.enume.ActionEnum;

public class ZAction {
	private String id;
	private ActionEnum action;
	private Object source;
	
	public Object getSource() {
		return source;
	}

	public ZAction(String id, ActionEnum action,Object source) {
		this.id = id;
		this.action = action;
		this.source=source;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public ActionEnum getAction() {
		return action;
	}

	public void setAction(ActionEnum action) {
		this.action = action;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((action == null) ? 0 : action.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((source == null) ? 0 : source.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass()) return false;
		ZAction other = (ZAction) obj;
		if (action != other.action) return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (source == null) {
			if (other.source != null)
				return false;
		} else if (!source.equals(other.source))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ZAction [id=" + id + ", action=" + action + ", source=" + source + "]";
	}
}
